﻿ using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using XWG.JWBST.JWBSTEntity;
using XWG.JWBST.JWBSTBLL;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;
using XWG.Framework.AuthUtility;
using System.Data;
using XWG.Framework;
using XWG.JWBST.JWBSTSPConst;
using XWG.Framework.AuthDAL;
using XWG.Framework.MSException;
using JWBST.CommonClass;

namespace XWG.JWBST.JWBSTManagementApp
{
    /// <summary>
    /// Service 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class Service : System.Web.Services.WebService
    {
        /// <summary>
        /// 返回类型类
        /// </summary>
        public class AjaxResultModel
        {
            public string result { get; set; }
            public int totalCount { get; set; }//总条数
            public int pageCount { get; set; }//总条数
            public object data { get; set; }//数据
        }
        [WebMethod]
        public void GetLoginId()
        {

            // HttpContext.Current.Request.Headers["Host"]
            string callback = HttpContext.Current.Request["para"].FilteHtml();
            var tm = TbBstOnlineAskBLL.SelectList();
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            //HttpContext.Current.Response.Charset = "GB2312";
            //HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); 
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            mResultModel.result = "ok";
            mResultModel.data = tm;
            mResultModel.totalCount = -1;
            mResultModel.pageCount = -1;
            HttpContext.Current.Response.Write(callback + "(" + JsonConvert.SerializeObject(mResultModel, dtConverter) + ")");
            HttpContext.Current.Response.End();
        }


    }
}
